let buffer = new Gtk.TextBuffer({ text: errortext });
let textview = new Gtk.TextView({
- buffer: buffer,
+ buffer,
wrap_mode: Gtk.WrapMode.WORD,
monospace: true,
editable: false,
else if (this._mode == AuthPromptMode.UNLOCK_OR_LOG_IN)
reauthenticationOnly = false;
- this._userVerifier = new GdmUtil.ShellUserVerifier(this._gdmClient, { reauthenticationOnly: reauthenticationOnly });
+ this._userVerifier = new GdmUtil.ShellUserVerifier(this._gdmClient, { reauthenticationOnly });
this._userVerifier.connect('ask-question', this._onAskQuestion.bind(this));
this._userVerifier.connect('show-message', this._onShowMessage.bind(this));
let userName = item.user.get_user_name();
let hold = new Batch.Hold();
- this._authPrompt.begin({ userName: userName,
- hold: hold });
+ this._authPrompt.begin({ userName, hold });
return hold;
}
let interval = this._getIntervalForMessage(message);
this.hasPendingMessages = true;
- this._messageQueue.push({ text: message, type: messageType, interval: interval });
+ this._messageQueue.push({ text: message, type: messageType, interval });
this._queueMessageTimeout();
}
try {
let [outVariant_, fdList] = proxy.call_with_unix_fd_list_finish(result);
fd = fdList.steal_fds()[0];
- callback(new Gio.UnixInputStream({ fd: fd }));
+ callback(new Gio.UnixInputStream({ fd }));
} catch (e) {
logError(e, "Error getting systemd inhibitor");
callback(null);
// We are only interested in the part in the parentheses. (And
// we can't pattern match the text, since it gets localized.)
let message = err.message.replace(/.*\((.+)\)/, '$1');
- throw new (err.constructor)({ code: err.code,
- message: message });
+ throw new (err.constructor)({ code: err.code, message });
} else {
throw err;
}
var PortalWindow = GObject.registerClass(
class PortalWindow extends Gtk.ApplicationWindow {
_init(application, url, timestamp, doneCallback) {
- super._init({ application: application });
+ super._init({ application });
this.connect('delete-event', this.destroyWindow.bind(this));
this._headerBar = new PortalHeaderBar();
}
Authenticate(connection, url, timestamp) {
- this._queue.push({ connection: connection, url: url, timestamp: timestamp });
+ this._queue.push({ connection, url, timestamp });
this._processQueue();
}
this.add_actor(this._highlight);
let coordinate = Clutter.BindCoordinate.ALL;
- let constraint = new Clutter.BindConstraint({ coordinate: coordinate });
+ let constraint = new Clutter.BindConstraint({ coordinate });
this._clone.bind_property('source', constraint, 'source', 0);
this.add_constraint(constraint);
var Animation = GObject.registerClass(
class Animation extends St.Bin {
_init(file, width, height, speed) {
- super._init({ width: width, height: height });
+ super._init({ width, height });
this.connect('destroy', this._onDestroy.bind(this));
this.connect('resource-scale-changed',
this._loadFile.bind(this, file, width, height));
else
opacity = 255;
this._items[id].ease({
- opacity: opacity,
+ opacity,
duration: INACTIVE_GRID_OPACITY_ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD
});
style_class: 'app-view-control button',
can_focus: true,
x_expand: true });
- this._views[Views.FREQUENT] = { 'view': view, 'control': button };
+ this._views[Views.FREQUENT] = { view, 'control': button };
view = new AllView();
button = new St.Button({ label: _("All"),
style_class: 'app-view-control button',
can_focus: true,
x_expand: true });
- this._views[Views.ALL] = { 'view': view, 'control': button };
+ this._views[Views.ALL] = { view, 'control': button };
this._viewStackLayout = new ViewStackLayout();
this._viewStack = new St.Widget({ x_expand: true, y_expand: true,
this._parentView = parentView;
this._folder = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders.folder',
- path: path });
+ path });
this._delegate = this;
// whether we need to update arrow side, position etc.
this._popupInvalidated = false;
_loadAnimation(file) {
this._cache.getAnimation({
- file: file,
+ file,
settingsSchema: this._settings.schema_id,
onLoaded: animation => {
this._animation = animation;
if (!(monitorIndex in this._backgrounds)) {
let background = new Background({
- monitorIndex: monitorIndex,
+ monitorIndex,
layoutManager: this._layoutManager,
settings: this._settings,
- file: file,
- style: style
+ file,
+ style
});
background._changedId = background.connect('bg-changed', () => {
let existingDialog = prevOperation ? prevOperation.borrowDialog() : null;
let operation =
new ShellMountOperation.ShellMountOperation(volume,
- { existingDialog: existingDialog });
+ { existingDialog });
this._mountVolume(volume, operation);
}
secret.entry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
text: secret.value, can_focus: reactive,
- reactive: reactive,
+ reactive,
x_expand: true });
ShellEntry.addContextMenu(secret.entry,
{ isPassword: secret.password });
contentOverride.secrets.push({
label: keyfile.get_string(groups[i], 'Label'),
key: groups[i],
- value: value,
+ value,
password: keyfile.get_boolean(groups[i], 'IsSecret'),
});
} else {
return {
messageType: tpMessage.get_message_type(),
- text: text,
+ text,
sender: tpMessage.sender.alias,
- timestamp: timestamp,
- direction: direction
+ timestamp,
+ direction
};
}
text: event.get_message(),
sender: event.get_sender().get_alias(),
timestamp: event.get_timestamp(),
- direction: direction
+ direction
};
}
getIcon() {
let file = this._contact.get_avatar_file();
if (file)
- return new Gio.FileIcon({ file: file });
+ return new Gio.FileIcon({ file });
else
return new Gio.ThemedIcon({ name: 'avatar-default' });
}
? 'received' : 'sent');
this._append({ body: messageBody,
- group: group,
- styles: styles,
+ group,
+ styles,
timestamp: message.timestamp,
- noTimestamp: noTimestamp });
+ noTimestamp });
}
_filterMessages() {
Main.activateWindow(windows[i], timestamp);
},
iconActor: icon,
- iconName: iconName,
+ iconName,
sortGroup: SortGroup.MIDDLE });
}
}
can_focus: true,
x_expand: true,
y_expand: true,
- label: label });
+ label });
button.connect('clicked', action);
buttonInfo['button'] = button;
this._confirm(signal);
});
},
- label: label,
+ label,
});
}
let _httpSession;
function installExtension(uuid, invocation) {
- let params = { uuid: uuid,
+ let params = { uuid,
shell_version: Config.PACKAGE_VERSION };
let message = Soup.form_request_new_from_hash('GET', REPOSITORY_URL_INFO, params);
scale_y: ANIMATION_BOUNCE_ICON_SCALE,
duration: bounceUpTime,
mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
- delay: delay,
+ delay,
onComplete: () => {
let duration = ANIMATION_TIME_IN - bounceUpTime;
actor.ease({
_makeKey(key) {
let label = GLib.markup_escape_text(key, -1);
let button = new St.Button({
- label: label,
+ label,
style_class: 'keyboard-key',
x_expand: true,
});
_createBackgroundManager(monitorIndex) {
let bgManager = new Background.BackgroundManager({ container: this._backgroundGroup,
layoutManager: this,
- monitorIndex: monitorIndex });
+ monitorIndex });
bgManager.connect('changed', this._addBackgroundMenu.bind(this));
this._addBackgroundMenu(bgManager);
findIndexForActor(actor) {
let [x, y] = actor.get_transformed_position();
let [w, h] = actor.get_transformed_size();
- let rect = new Meta.Rectangle({ x: x, y: y, width: w, height: h });
+ let rect = new Meta.Rectangle({ x, y, width: w, height: h });
return global.display.get_monitor_index_for_rect(rect);
}
h = Math.round(h);
if (actorData.affectsInputRegion && wantsInputRegion && actorData.actor.get_paint_visibility())
- rects.push(new Meta.Rectangle({ x: x, y: y, width: w, height: h }));
+ rects.push(new Meta.Rectangle({ x, y, width: w, height: h }));
let monitor = null;
if (actorData.affectsStruts)
}
let strutRect = new Meta.Rectangle({ x: x1, y: y1, width: x2 - x1, height: y2 - y1 });
- let strut = new Meta.Strut({ rect: strutRect, side: side });
+ let strut = new Meta.Strut({ rect: strutRect, side });
struts.push(strut);
}
}
let currTime = global.get_current_time();
if ((currTime - this._lastTabTime) < AUTO_COMPLETE_DOUBLE_TAB_DELAY) {
this._processCompletionRequest({ tabType: 'double',
- completions: completions,
- attrHead: attrHead });
+ completions,
+ attrHead });
} else {
this._processCompletionRequest({ tabType: 'single',
- completions: completions,
- attrHead: attrHead });
+ completions,
+ attrHead });
}
this._lastTabTime = currTime;
}
scrollview.get_hscroll_bar().hide();
scrollview.add_actor(child);
- let tabData = { child: child,
- labelBox: labelBox,
- label: label,
+ let tabData = { child,
+ labelBox,
+ label,
scrollView: scrollview,
_scrollToBottom: false };
this._tabs.push(tabData);
* of the magnified view.
*/
setMagFactor(xMagFactor, yMagFactor) {
- this._changeROI({ xMagFactor: xMagFactor,
- yMagFactor: yMagFactor,
+ this._changeROI({ xMagFactor,
+ yMagFactor,
redoCursorTracking: this._followingCursor });
}
modalActorFocusStack[index].prevFocus = null;
});
}
- modalActorFocusStack.push({ actor: actor,
+ modalActorFocusStack.push({ actor,
destroyId: actorDestroyId,
- prevFocus: prevFocus,
- prevFocusDestroyId: prevFocusDestroyId,
- actionMode: actionMode });
+ prevFocus,
+ prevFocusDestroyId,
+ actionMode });
actionMode = params.actionMode;
global.stage.set_key_focus(actor);
function initializeDeferredWork(actor, callback) {
// Turn into a string so we can use as an object property
let workId = `${(++_deferredWorkSequence)}`;
- _deferredWorkData[workId] = { 'actor': actor,
- 'callback': callback };
+ _deferredWorkData[workId] = { actor,
+ callback };
actor.connect('notify::mapped', () => {
if (!(actor.mapped && _deferredWorkQueue.includes(workId)))
return;
// @label: the label for the action's button
// @callback: the callback for the action
addAction(label, callback) {
- this.actions.push({ label: label, callback: callback });
+ this.actions.push({ label, callback });
}
get acknowledged() {
addAction(label, callback) {
let button = new St.Button({ style_class: 'notification-button',
- label: label,
+ label,
x_expand: true,
can_focus: true });
}
}, class Source extends GObject.Object {
_init(title, iconName) {
- super._init({ title: title });
+ super._init({ title });
this.SOURCE_ICON_SIZE = 48;
if (this._player.trackCoverUrl) {
let file = Gio.File.new_for_uri(this._player.trackCoverUrl);
- this._icon.gicon = new Gio.FileIcon({ file: file });
+ this._icon.gicon = new Gio.FileIcon({ file });
this._icon.remove_style_class_name('fallback');
} else {
this._icon.icon_name = 'audio-x-generic-symbolic';
hints['image-data'] = hints['icon_data'];
}
- let ndata = { appName: appName,
- icon: icon,
- summary: summary,
- body: body,
- actions: actions,
- hints: hints,
- timeout: timeout };
+ let ndata = { appName,
+ icon,
+ summary,
+ body,
+ actions,
+ hints,
+ timeout };
if (replacesId != 0 && this._notifications[replacesId]) {
ndata.id = id = replacesId;
ndata.notification = this._notifications[replacesId].notification;
else if (!gicon)
gicon = this._fallbackIconForNotificationData(hints);
- notification.update(summary, body, { gicon: gicon,
+ notification.update(summary, body, { gicon,
bannerMarkup: true,
clear: true,
soundFile: hints['sound-file'],
_updateWorkspacesGeometry() {
let [x, y] = this.get_transformed_position();
let [width, height] = this.get_transformed_size();
- let geometry = { x: x, y: y, width: width, height: height };
+ let geometry = { x, y, width, height };
let spacing = this.get_theme_node().get_length('spacing');
let dashWidth = this._dashSlider.getVisibleWidth() + spacing;
let red = Math.min((color.red * 255 + 127) / color.alpha, 255);
let green = Math.min((color.green * 255 + 127) / color.alpha, 255);
let blue = Math.min((color.blue * 255 + 127) / color.alpha, 255);
- return new Clutter.Color({ red: red, green: green,
- blue: blue, alpha: color.alpha });
+ return new Clutter.Color({ red, green, blue, alpha: color.alpha });
}
class AppMenu extends PopupMenu.PopupMenu {
_init(text, params) {
super._init(params);
- this.label = new St.Label({ text: text });
+ this.label = new St.Label({ text });
this.add_child(this.label);
this.label_actor = this.label;
}
_init(text, active, params) {
super._init(params);
- this.label = new St.Label({ text: text });
+ this.label = new St.Label({ text });
this._switch = new Switch(active);
this.accessible_role = Atk.Role.CHECK_MENU_ITEM;
this._icon = new St.Icon({ style_class: 'popup-menu-icon',
x_align: Clutter.ActorAlign.END });
this.add_child(this._icon);
- this.label = new St.Label({ text: text });
+ this.label = new St.Label({ text });
this.add_child(this.label);
this.label_actor = this.label;
this.add_child(this.icon);
}
- this.label = new St.Label({ text: text,
+ this.label = new St.Label({ text,
y_expand: true,
y_align: Clutter.ActorAlign.CENTER });
this.add_child(this.label);
return;
let menudata = {
- menu: menu,
+ menu,
openStateChangeId: menu.connect('open-state-changed', this._onMenuOpenState.bind(this)),
destroyId: menu.connect('destroy', this._onMenuDestroy.bind(this)),
enterId: 0,
}
if (gicon)
- icon = new St.Icon({ gicon: gicon,
- icon_size: size });
+ icon = new St.Icon({ gicon, icon_size: size });
return icon;
}
height: monitor.height });
let bgManager = new Background.BackgroundManager({ container: widget,
- monitorIndex: monitorIndex,
+ monitorIndex,
controlPosition: false,
settingsSchema: SCREENSAVER_SCHEMA });
});
} else {
this._lockScreenGroup.fixed_position_set = false;
- this._lockScreenShown({ fadeToBlack: fadeToBlack,
- animateFade: false });
+ this._lockScreenShown({ fadeToBlack, animateFade: false });
}
this._lockScreenGroup.grab_key_focus();
"Invalid params");
return;
}
- let flashspot = new Flashspot({ x: x, y: y, width: width, height: height });
+ let flashspot = new Flashspot({ x, y, width, height });
flashspot.fire();
invocation.return_value(null);
}
let id = layouts[i];
if (variants[i])
id += `+${variants[i]}`;
- sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id: id });
+ sourcesList.push({ type: INPUT_SOURCE_TYPE_XKB, id });
}
return sourcesList;
}
for (let i = 0; i < nSources; i++) {
let [type, id] = sources.get_child_value(i).deep_unpack();
- sourcesList.push({ type: type, id: id });
+ sourcesList.push({ type, id });
}
return sourcesList;
}
}
if (exists)
- infosList.push({ type: type, id: id, displayName: displayName, shortName: shortName });
+ infosList.push({ type, id, displayName, shortName });
}
if (infosList.length == 0) {
let type = INPUT_SOURCE_TYPE_XKB;
let id = KeyboardManager.DEFAULT_LAYOUT;
let [, displayName, shortName] = this._xkbInfo.get_layout_info(id);
- infosList.push({ type: type, id: id, displayName: displayName, shortName: shortName });
+ infosList.push({ type, id, displayName, shortName });
}
let inputSourcesByShortName = {};
this._ensureSource();
let gicon = new Gio.ThemedIcon({ name: iconName });
- this._notification = new MessageTray.Notification(this._source, title, text, { gicon: gicon });
+ this._notification = new MessageTray.Notification(this._source, title, text, { gicon });
this._notification.setUrgency(urgency);
this._notification.setTransient(true);
this._notification.connect('destroy', () => {
userName = null;
}
- this._authPrompt.begin({ userName: userName });
+ this._authPrompt.begin({ userName });
}
_escape() {
this._resizePending.add(actor);
actor.__animationInfo = { clone: actorClone,
oldRect: oldFrameRect,
- destroyId: destroyId };
+ destroyId };
}
_sizeChangedWindow(shellwm, actor) {
if (numColumns == lastLayout.numColumns)
break;
- let layout = { area: area, strategy: strategy, numRows: numRows, numColumns: numColumns };
+ let layout = { area, strategy, numRows, numColumns };
strategy.computeLayout(windows, layout);
strategy.computeScaleAndSpace(layout);
_getMonitorIndexForEvent(event) {
let [x, y] = event.get_coords();
- let rect = new Meta.Rectangle({ x: x, y: y, width: 1, height: 1 });
+ let rect = new Meta.Rectangle({ x, y, width: 1, height: 1 });
return global.display.get_monitor_index_for_rect(rect);
}
let allocation = this.allocation;
let width = allocation.x2 - allocation.x1;
let height = allocation.y2 - allocation.y1;
- let primaryGeometry = { x: x, y: y, width: width, height: height };
+ let primaryGeometry = { x, y, width, height };
let monitors = Main.layoutManager.monitors;
for (let i = 0; i < monitors.length; i++) {
Main.uiGroup.set_child_above_sibling(this._cursorWindowClone, null);
let dragEvent = {
- x: x,
- y: y,
+ x,
+ y,
dragActor: this._cursorWindowClone ? this._cursorWindowClone : this._dummy,
source: this,
targetActor: pickedActor